package com.bjpowernode;

import com.bjpowernode.manager.RedisManager;
import jakarta.annotation.Resource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;

@MapperScan(basePackages = {"com.bjpowernode.mapper"})
@SpringBootApplication
public class DlykServerApplication implements CommandLineRunner {

	@Resource
	private RedisTemplate<String, Object> redisTemplate;

	public static void main(String[] args) {
		SpringApplication.run(DlykServerApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		redisTemplate.setKeySerializer(new StringRedisSerializer());
		redisTemplate.setValueSerializer(new StringRedisSerializer());
	}
}
